<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SARibbon: SARibbonElementManager类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="SA-logo.png"/></td>
  <td id="projectalign">
   <div id="projectname">SARibbon<span id="projectnumber">&#160;2.4.2</span>
   </div>
   <div id="projectbrief">SARibbon wiki</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('class_s_a_ribbon_element_manager.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_s_a_ribbon_element_manager-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">SARibbonElementManager类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>此类是一个全局单例，用于管理SARibbonElementFactory  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_s_a_ribbon_element_manager_8h_source.html">SARibbonElementManager.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ac917e2bed5a6a91a1ad9312c72a30d77" id="r_ac917e2bed5a6a91a1ad9312c72a30d77"><td class="memItemLeft" align="right" valign="top"><a id="ac917e2bed5a6a91a1ad9312c72a30d77" name="ac917e2bed5a6a91a1ad9312c72a30d77"></a>
<a class="el" href="class_s_a_ribbon_element_factory.html">SARibbonElementFactory</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>factory</b> ()</td></tr>
<tr class="separator:ac917e2bed5a6a91a1ad9312c72a30d77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb661e60aaff101a33a13c5f954fda78" id="r_aeb661e60aaff101a33a13c5f954fda78"><td class="memItemLeft" align="right" valign="top"><a id="aeb661e60aaff101a33a13c5f954fda78" name="aeb661e60aaff101a33a13c5f954fda78"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setupFactory</b> (<a class="el" href="class_s_a_ribbon_element_factory.html">SARibbonElementFactory</a> *fac)</td></tr>
<tr class="separator:aeb661e60aaff101a33a13c5f954fda78"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a6dcc7493beb84bb810d0821e86febbbb" id="r_a6dcc7493beb84bb810d0821e86febbbb"><td class="memItemLeft" align="right" valign="top"><a id="a6dcc7493beb84bb810d0821e86febbbb" name="a6dcc7493beb84bb810d0821e86febbbb"></a>
static <a class="el" href="class_s_a_ribbon_element_manager.html">SARibbonElementManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>instance</b> ()</td></tr>
<tr class="separator:a6dcc7493beb84bb810d0821e86febbbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>此类是一个全局单例，用于管理SARibbonElementFactory </p>
<p>如果你有自己的某个部件要重写，首先你需要有自己的ElementFactory </p><div class="fragment"><div class="line"><span class="keyword">class </span>MyRibbonElementFactory : <span class="keyword">public</span> <a class="code hl_class" href="class_s_a_ribbon_element_factory.html">SARibbonElementFactory</a>{</div>
<div class="line"><span class="keyword">public</span>:</div>
<div class="line">    ...</div>
<div class="line">    <span class="keyword">virtual</span> <a class="code hl_class" href="class_s_a_ribbon_pannel.html">SARibbonPannel</a>* createRibbonPannel(QWidget* parent){</div>
<div class="line">        <span class="keywordflow">return</span> <span class="keyword">new</span> MyRibbonPannel(parent);</div>
<div class="line">    }</div>
<div class="line">};</div>
<div class="ttc" id="aclass_s_a_ribbon_element_factory_html"><div class="ttname"><a href="class_s_a_ribbon_element_factory.html">SARibbonElementFactory</a></div><div class="ttdoc">SARibbon的子元素创建的工厂，SARibbon内部创建子元素都通过SARibbonElementFactory来创建</div><div class="ttdef"><b>Definition</b> SARibbonElementFactory.h:35</div></div>
<div class="ttc" id="aclass_s_a_ribbon_pannel_html"><div class="ttname"><a href="class_s_a_ribbon_pannel.html">SARibbonPannel</a></div><div class="ttdoc">pannel页窗口，pannel是ribbon的面板用于承放控件</div><div class="ttdef"><b>Definition</b> SARibbonPannel.h:51</div></div>
</div><!-- fragment --><p>然后，你需要在ribbonbar创建之前把自己的ElementFactory设置进去</p>
<p>这个一般会在main函数中进行</p>
<div class="fragment"><div class="line">SARibbonElementManager::instance()-&gt;setupFactory(<span class="keyword">new</span> MyRibbonElementFactory);</div>
</div><!-- fragment --><p>这样，SARibbon创建的pannel就是你自己重写的MyRibbonPannel </p>
</div><hr/>该类的文档由以下文件生成:<ul>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/<a class="el" href="_s_a_ribbon_element_manager_8h_source.html">SARibbonElementManager.h</a></li>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/<b>SARibbonElementManager.cpp</b></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_s_a_ribbon_element_manager.html">SARibbonElementManager</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
